﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using Codemonk.Common.Logging;
using Codemonk.CloudBox.Unity.Logging;
using Codemonk.CloudBox.Adapters.Logging;

namespace Codemonk.CloudBox.UnitTests
{
    [TestClass]
    public class LogTest
    {
        [TestMethod]
        public void ConsoleLog()
        {
            ILog log = new ConsoleLog();
            log.Record(LogLevel.Debug, "测试输出");
            log.Record(LogLevel.Error, "我在测试");
            log.Record(LogLevel.Waring, "这个是第三条语句");
        }

        [TestMethod]
        public void DiagnosticLog()
        {
            ILog log = new DiagnosticLog();
            log.Record(LogLevel.Debug, "测试输出");
            log.Record(LogLevel.Error, "我在测试");
            log.Record(LogLevel.Waring, "这个是第三条语句");
        }

        [TestMethod]
        public void ConsoleLogFactory()
        {
            ILogFactory factory = new ConsoleLogFactory();
            ILog log = factory.Get();
            log.Record(LogLevel.Debug, "测试输出");
            log.Record(LogLevel.Error, "我在测试");
            log.Record(LogLevel.Waring, "这个是第三条语句");
        }

        [TestMethod]
        public void Log4NetLogFactory()
        {
            ILogFactory factory = new Log4NetLogFactory();
            ILog log = factory.Get();
            log.Record(LogLevel.Debug, "测试输出");
            log.Record(LogLevel.Error, "我在测试");
            log.Record(LogLevel.Waring, "这个是第三条语句");
        }
    }
}
